﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

/// <summary>
/// Summary description for Image
/// </summary>
public class Image
{
    private Control hostForm;
	public Image()
	{
		//
		// TODO: Add constructor logic here
		//
	}
    public Control HostForm
    {
        set
        {
            hostForm = value;
        }
    }
    public void SelectAdd()
    {
        if (hostForm.ToString() == "ASP.default_aspx")
        {
            AddDefault();
            AddContent();
        }
        else
        {
            AddDefault();
            AddTopMenu();
        }
    }
    private void AddDefault()
    {
        hostForm.Controls.Add(new LiteralControl(@"
            <img src=" + GlobalVar.imageFloorSideMenu + @" class='login'>
            "));
    }
    private void AddContent()
    {
        hostForm.Controls.Add(new LiteralControl(@"
            <img src=" + GlobalVar.imageFloorContent + @" class='content'>
            "));
    }

    private void AddTopMenu()
    {
        hostForm.Controls.Add(new LiteralControl(@"
            <img src=" + GlobalVar.imageFloorTopMenu + @" class='top_menu'>
            "));
    }
}
